<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<WASM.WebSite.DataEntities.AzureStorage>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Azure Storage List
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<h2>
		Azure Storage List</h2>
	<table>
		<tr>
			<th>
			</th>
			<th>
				Name
			</th>
			<th>
				Account Name
			</th>
			<th>
				Url
			</th>
			<th>
				Type
			</th>
		</tr>
		<% foreach (var item in Model)
		 { %>
		<tr>
			<td>
				<% if (item.AzureStorageTypeId == (int)WASM.WebSite.Logic.Storage.AzureStorageTypeEnum.Sql)
			 {%>
				<%= Html.ActionLink("Open", "Query", "Sql", new { storageId = item.AzureStorageId }, null)	%>
				|
				<%= Html.ActionLink("Edit", "EditSql", new { id = item.AzureStorageId }) %>
				<%}
			 else
			 { %>
				<%= Html.ActionLink("Open", "List", WASM.WebSite.Models.AzureStorageUserSettingsRepository.GetAzureStorageTypeName(item.AzureStorageTypeId), new { storageId = item.AzureStorageId }, null)%>
				|
				<%= Html.ActionLink("Edit", "Edit", new { id = item.AzureStorageId }) %>
				<%}%>
				|
				<%= Html.ActionLink("Delete", "Delete", new { id = item.AzureStorageId }, new { onclick = "return confirm('Are you sure?')" } )%>
			</td>
			<td>
				<%= Html.Encode(item.asName) %>
			</td>
			<td>
				<%= Html.Encode(item.asAccountName)%>
			</td>
			<td>
				<%= Html.Encode(item.asUrl) %>
			</td>
			<td>
				<%= Html.Encode(WASM.WebSite.Models.AzureStorageUserSettingsRepository.GetAzureStorageTypeName(item.AzureStorageTypeId)) %>
			</td>
		</tr>
		<% } %>
	</table>
	<p>
		<%= Html.ActionLink("Add New Storage", "Create") %>
		|
		<%= Html.ActionLink("Add New Sql Connection", "CreateSql") %>
	</p>
</asp:Content>
